<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>classmarkov</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>classmarkov</b> -  recurrent and transient classes of Markov matrix</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[perm,rec,tr,indsRec,indsT]=classmarkov(M)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>M</b>
        </tt>: real N x N Markov matrix. Sum of entries in each row should add to one.</li>
      <li>
        <tt>
          <b>perm</b>
        </tt>: integer permutation vector.</li>
      <li>
        <tt>
          <b>rec, tr</b>
        </tt>: integer vector, number (number of states in each recurrent classes, number of transient states).</li>
      <li>
        <tt>
          <b>indsRec,indsT</b>
        </tt>: integer vectors. (Indexes of recurrent and transient states).</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    Returns a permutation vector <tt>
        <b>perm</b>
      </tt> such that</p>
    <pre>

M(perm,perm) = [M11 0 0 0 0   0]
               [0 M22 0 0     0]
               [0 0 M33       0]
               [      ...      ]
               [0 0       Mrr 0]
               [* *        *  Q]
   
    </pre>
    <p>
    Each <tt>
        <b>Mii</b>
      </tt> is a Markov matrix of dimension <tt>
        <b>rec(i)  i=1,..,r</b>
      </tt>.
    <tt>
        <b>Q</b>
      </tt> is sub-Markov matrix of dimension <tt>
        <b>tr</b>
      </tt>.
    States 1 to sum(rec) are recurrent and states from r+1 to n
    are transient. 
    One has <tt>
        <b>perm=[indsRec,indsT]</b>
      </tt> where indsRec is a  vector of size sum(rec) 
    and indsT is a vector of size tr.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

//P has two recurrent classes (with 2 and 1 states) 2 transient states
P=genmarkov([2,1],2,'perm')
[perm,rec,tr,indsRec,indsT]=classmarkov(P);
P(perm,perm)
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="genmarkov.htm">
        <tt>
          <b>genmarkov</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="eigenmarkov.htm">
        <tt>
          <b>eigenmarkov</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
